﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace LastfmNet.Models
{
    public class Wiki : LastfmModelBase
    {
        public Wiki()
        {
            this.Published = DateTime.MinValue;
            this.Summary = string.Empty;
            this.Content = string.Empty;
        }

        public Wiki(XmlNode wikiNode)
        : this()
        {
            if (wikiNode == null) return;
            this.InitializeFromXmlNode(wikiNode);
        }

        public override void InitializeFromXmlNode(XmlNode node)
        {
            if (node == null) return;
            this.Published = node.GetChildValue("published").ToDateTime();
            this.Summary = node.GetChildValue("summary");
            this.Content = node.GetChildValue("content");
        }

        public DateTime Published { get; set; }

        public string Summary { get; set; }

        public string Content { get; set; }
    }
}
